package com.zzj.hotel.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zzj.hotel.core.entity.Classify;
import com.zzj.hotel.dao.ClassifyDao;
import com.zzj.hotel.service.ClassifyService;

public class ClassifyServiceImpl implements ClassifyService {
	private ClassifyDao classifyDao;

	public ClassifyDao getClassifyDao() {
		return classifyDao;
	}

	public void setClassifyDao(ClassifyDao classifyDao) {
		this.classifyDao = classifyDao;
	}

	public Classify findById(String id) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(Classify.CLASSIFY_ID, id);
		return classifyDao.selectOne(queryMap);
	}

	public List<Classify> findAll() {
		return classifyDao.selectList(null);
	}

	public List<Classify> findList(String belongto) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(Classify.CLASSIFY_BELONGTO, belongto);
		return classifyDao.selectList(queryMap);
	}

	public void updateClassify(Classify classify) {
		classifyDao.update(classify);
	}

	public void deleteClassify(String id) {
		classifyDao.deleteById(id);
	}

	public void insertClassify(Classify classify) {
		classifyDao.insert(classify);
	}
}
